@table-prefix: ~'@{prefix}table';
@table-select-item-prefix: ~'@{table-prefix}-filter-select-item';

.@{table-prefix} {
  border: @border;
  position: relative;
  th {
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
    height: 40px;
    position: relative;
  }
  th,
  td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    box-sizing: border-box;
    min-width: 0;
    padding: 3px 0px 3px 8px;
    vertical-align: middle;
    &.text-right {
      padding-right: 8px;
      padding-left: 0;
    }
    &.text-center {
      padding-right: 0;
      padding-left: 0;
    }
  }
  th&-th-checkbox,
  td&-td-checkbox {
    text-align: center;
    text-overflow: clip;
    padding-left: 0;
  }
  th&-th-radio,
  td&-td-radio {
    text-align: center;
    text-overflow: clip;
    padding-left: 0;
  }
  td {
    font-size: @font-size-mini;
    height: 40px;
    border-top: @border;
  }
  table {
    table-layout: fixed;
    border-spacing: 0;
  }
  &-header {
    background-color: @gray4-color;
    position: relative;
    overflow: hidden;
    table {
      width: 100%;
    }
    border-bottom: @border;
  }

  &-body {
    overflow: auto;
  }
  &-container {
    position: relative;
    margin-top: -1px;
    background: #fff;
    &.h-loading-parent {
      min-height: 40px;
    }

    table {
      width: 100%;
    }
  }

  &-fixed-right,
  &-fixed-left {
    z-index: 1;
    position: absolute;
    top: 0;
    background: #FFF;
    bottom: 0;
    overflow: hidden;
    table {
      background: @white-color;
    }
  }

  &-fixed-right table {
    float: right;
  }
  &-fixed-header-right,
  &-fixed-header-left {
    z-index: 1;
    position: absolute;
    top: 0;
    overflow: hidden;
    table {
      background: @gray4-color;
    }
    border-bottom: @border;
  }

  &-fixed-cover {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 1px;
    background: @gray4-color;
    z-index: 2;
  }

  &-fixed-right,
  &-fixed-header-right {
    right: 0;
    box-shadow: -2px 0px 6px -2px rgba(0, 0, 0, 0.2);
  }

  &-fixed-left,
  &-fixed-header-left {
    left: 0;
    box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.2);
  }

  &-border {
    border-left: 0;
    td,
    th {
      border-left: @border;
    }
    th {
      border-bottom: @border;
    }
    .h-table-header table {
      margin-bottom: -1px;
    }
    .h-table-content-empty {
      border-left: @border;
      border-top: @border;
    }
  }

  &-border &-fixed-right,
  &-border &-fixed-header-right {
    td,
    th {
      border-right: none;
    }
  }

  &-stripe {
    .h-table-tbody tr:nth-child(2n) {
      background-color: #fcfcfc;
    }
  }

  & &-tbody tr {
    &.h-table-tr-hovered {
      background-color: @hover-background-color;

      &.h-table-expand-tr {
        background-color: transparent;
      }
    }
    &.h-table-tr-selected {
      background-color: @highlight-background-color;
    }
  }

  &-content-empty {
    color: @dark4-color;
    text-align: center;
    box-sizing: border-box;
    padding: 20px;
  }
  &-sort-handler {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    font-size: 12px;
    color: @gray1-color;
    transition: color @transition-time;
    th:hover & {
      color: @dark4-color;
    }
    > span {
      cursor: pointer;
      // &:hover {
      //   color: @dark-color;
      // }
      &.@{table-prefix}-sort-selected {
        color: @primary-color;
      }
    }
  }

  &-tr-select-disabled {
    background: @disabled-background-color;
  }
  &-content-empty-width{
    height: 1px;
  }
  &-tree-icon {
    font-size: 14px;
    .h-func-text-hover();
  }
  &-tree-empty {
    display: inline-block;
    width: 14px;
  }
  &-tree-expand-space {
    display: inline-block;
    width: 8px;
  }
  &-tree-opened {
    .h-table-tree-icon{
      transform: rotate(90deg);
    }
  }
}
